using System;
using System.Data;

namespace Dbam.DbFramework.SampleConsole
{
	[Table("Sessions")]
	class Session
	{
		private Guid _id;
		private Guid _parentAccountId;
		private DateTime _beginTime;
		private DateTime _endTime;

		public Session()
		{
			_id = Guid.NewGuid();
			_parentAccountId = new Guid();
			_beginTime = DateTime.Now;
			_endTime = DateTime.MaxValue;
		}

		[Column("Id", DbType.Guid, true)]
		public Guid Id
		{
			get { return _id; }
			set { _id = value; }
		}

		[Column("AccountId", DbType.Guid, false)]
		internal Guid ParentAccountId
		{
			get { return _parentAccountId; }
			set { _parentAccountId = value; }
		}

		[Column("StartTime", DbType.DateTime, false)]
		public DateTime BeginTime
		{
			get { return _beginTime; }
			set { _beginTime = value; }
		}

		[Column("EndTime", DbType.DateTime, false)]
		public DateTime EndTime
		{
			get { return _endTime; }
			set { _endTime = value; }
		}
	}
}
